using System;
using Be.Timvw.Framework.Namespace1;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Be.Timvw.Framework
{
    [TestClass]
    public class WhenComparingTypes
    {
        [TestMethod]
        public void ShouldReturnSmallerThanZeroWhenFirstNamespaceIsSmallerThanSecondNamespace()
        {
            Type ns1Dummy1 = typeof(Dummy1);
            Type intType = typeof(int);
            int compareResult = TypeHelper.CompareTypes(ns1Dummy1, intType);
            Assert.IsTrue(compareResult < 0);
        }

        [TestMethod]
        public void ShouldReturnLargerThanZeroWhenFirstTypeNameIsLargerThanSecondTypeName()
        {
            Type ns1Dummy1 = typeof(Dummy1);
            Type ns2Dummy1 = typeof(Namespace2.Dummy1);
            int compareResult = TypeHelper.CompareTypes(ns2Dummy1, ns1Dummy1);
            Assert.IsTrue(compareResult > 0);
        }

        [TestMethod]
        public void ShouldReturnSmallerThanZeroWhenFirstTypeNameIsSmallerThanSecondTypeName()
        {
            Type ns1Dummy1 = typeof(Dummy1);
            Type ns1Dummy2 = typeof(Dummy2);
            int compareResult = TypeHelper.CompareTypes(ns1Dummy1, ns1Dummy2);
            Assert.IsTrue(compareResult < 0);
        }
    }
}